<?php
/**
 * Created by PhpStorm.
 * User: lenovo
 * Date: 2016/9/28
 * Time: 20:13
 */
?>
<html xmlns="http://www.w3.org/1999/html">
    <head>
        <style>.out{border: solid 4px #00bfbf;background-color:#ffffff;width: 200px;height: 200px;p}
                .in{border: solid 2px #00bfbf;background-color: #8bc9e3;width: 180px;height: 180px;
                    font-size: 18px;margin-left:8px;margin-top: 7px;position: relative;}</style>

    <div class="out">
        <div class="in">
<?php
  $line=1;
while ($line<=9) {
    $empty_pos = 0;
    $star_pos = 18;
    $empty = $line-1 ;
    $star = 1+ ($line-1) * 2;
    while ($empty_pos<$empty) {
        echo '&nbsp;';
        $empty_pos++;
    }
    while ($star_pos > $star) {
        echo '*';
        $star_pos--;
    }
    echo '<br>';
    ++$line;
}
?>
        </div>
        </div>
    </body>
</head>
</html>
